﻿using Model.BusinessModel.OutPut;
using Model.OverallAtuhModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utility;

namespace DomainService.IService.OverallAuth
{
    /// <summary>
    /// OverallAuth 系统接口
    /// </summary>
    public interface IOverallAuthApiService
    {

        #region  公司相关

        /// <summary>
        /// 获取公司接口
        /// </summary>
        /// <returns></returns>
        ReceiveStatus<List<SelectOutPut>> GetCorporation();

        #endregion

        #region  菜单相关

        /// <summary>
        /// 获取用户所属菜单
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="corporationKey">公司key</param>
        /// <param name="systemKey">系统key</param>
        /// <returns>返回用户所属菜单</returns>
        ReceiveStatus<List<SysMenuOutPut>> GetMenuByUserId(LoginOutPut loginOutPut);

        #endregion

        #region 按钮相关

        /// <summary>
        /// 获取菜单按钮权限
        /// </summary>
        /// <param name="menuId">菜单key</param>
        /// <param name="buttonRoleType">按钮类型</param>
        /// <param name="loginOutPut">登录信息</param>
        /// <returns></returns>
        ReceiveStatus<List<SysButtonDataOutPut>> GetMenuButtonAuthList(string menuId, int buttonRoleType, LoginOutPut loginOutPut);

        /// <summary>
        /// 获取数据按钮权限
        /// </summary>
        /// <param name="input">匹配模型</param>
        /// <param name="loginOutPut">登录信息</param>
        /// <returns></returns>
        ReceiveStatus<List<SysButtonDataOutPut>> GetMenuDataButtonAuth(MatchingDataButtonAuthInput input, LoginOutPut loginOutPut);

        /// <summary>
        /// 获取按钮
        /// </summary>
        /// <param name="menuId">菜单key</param>
        /// <param name="buttonRoleType">按钮类型</param>
        /// <param name="token"></param>
        /// <returns></returns>
        ReceiveStatus<List<SysButtonDataOutPut>> GetMenuButtonList(string menuId, int buttonRoleType, string token);

        #endregion

        #region  用户相关

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="loginModel">登录模型</param>
        /// <returns></returns>
        ReceiveStatus<List<LoginOutPut>> Login(LoginInput loginModel);

        /// <summary>
        /// 根据公司获取人员
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<List<SelectOutPut>> GetUserByCorporationKey(string corporationKey);


        /// <summary>
        /// 根据公司获取所有用户
        /// 构建用户缓存
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<List<SysUser>> GetAllUserByCorporationKey(string corporationKey);

        /// <summary>
        /// 根据公司获取所有部门数据
        /// 构建部门缓存
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<List<SysDepartment>> GetAllDepartmentByCorporationKey(string corporationKey);

        /// <summary>
        /// 根据公司获取所有部门数据--树形结构
        /// 构建部门缓存
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<List<TreeOutPut>> GetDepartmentTree(string corporationKey);

        /// <summary>
        /// 获取部门下的人员
        /// </summary>
        /// <param name="corporationKey">公司key</param>
        /// <returns></returns>
        ReceiveStatus<List<TreeOutPut>> GetDepartmentUser(string corporationKey);

        /// <summary>
        /// 根据菜单id获取列，用于数据列权限
        /// </summary>
        /// <param name="menuId">菜单id</param>
        /// <returns></returns>
        ReceiveStatus<List<SysMenuTableColsOutPut>> GetTableColsByMenuId(string menuId);

        /// <summary>
        /// 同步数据列
        /// </summary>
        /// <param name="loginOutPut">登录人员信息</param>
        /// <returns></returns>
        ReceiveStatus SynchronousCols(LoginOutPut loginOutPut);

        #endregion
    }
}
